<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateAppChannelTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('app_channel', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->tinyInteger('platform')->default(1)->comment('平台：1-IOS，2-安卓');
            $table->string('package_name', 30)->default('')->comment('包名');
            $table->string('channel', 10)->default('')->comment('渠道号');
            $table->string('channel_name', 10)->default('')->comment('渠道号备注');
            $table->string('apk_name', 30)->default('')->comment('APK包');
            $table->string('app_version', 10)->default('')->comment('版本号');
            $table->string('download_link', 200)->default('')->comment('下载链接');
            $table->integer('stat_link_click')->default(0)->comment('链接点击次数');
            $table->integer('stat_link_download')->default(0)->comment('链接下载次数');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('状态：1-有效 0-无效');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('app_channel');
    }
}
